<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'大用户',

    // preloading 'log' component
    'preload'=>array('log'),

    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.behaviors.*',
        'application.widgets.*',

    ),

    'modules'=>array(
        'api'=>array(
            'class'=>'application.modules.api.ApiModule'
        ),
        'admin'=>array(
            'class'=>'application.modules.admin.AdminModule'
        ),
    ),

    // application components
    'components'=>array(
        'user'=>array(
            // enable cookie-based authentication
            'class' => 'WebUser',
            // 'class'=>'application.modules.admin.components.BWebUser',
            'allowAutoLogin'=>true,
        ),
        'session' => array(
            'autoStart'=>true,
            //'cookieParams' => array('domain' => '.zhilebd.com'),
        ),
        // uncomment the following to enable URLs in path-format
        'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName'=> false,
            'rules'=>array(
                'images/<name>'=>'files/image',
                'imagecache/<name>'=>'files/imagecache',
                'download/<name>'=>'files/index',
                'order/notify/<platform>'=>'order/notify',
            ),
        ),
        'db'=>require(dirname(__FILE__).'/database.php'),
        'cache'=>array(
            'class'=>'CFileCache',
            // 'cachePath'=>'/tmp/yii.azeroth.cache'
        ),
        'curl' => array(
            'class' => 'ext.Curl',
            'options'=>array(
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_FOLLOWLOCATION => false,
                CURLOPT_AUTOREFERER => true,
                CURLOPT_CONNECTTIMEOUT => 30,
                CURLOPT_TIMEOUT => 30,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:5.0) Gecko/20110619 Firefox/5.0'
            )
        ),
        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning',
                ),
                // array(
                //    'class'=>'CWebLogRoute',
                //    'ignoreAjaxInFireBug' => false,
                // ),
            ),
        ),
    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']

);
